<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>个人中心</title>
<link rel="stylesheet" href="css/my.css" type="text/css" >
<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-1.11.3.min.js">
</script>
  <script type="text/javascript">
   
  window.onload=function(){
	  document.getElementById("gwc").style.display="none";
	  document.getElementById("yhxx").style.display="block";
	  document.getElementById("dzf").style.display="none";
	  document.getElementById("ddan").style.display="none";
	  document.getElementById("dianjif").style.border="1px solid #B0C4DE";
	  
	  var str=document.getElementsByClassName("zbc");
	  for(var i=0;i<str.length;i++){
	  	if(str[i].innerHTML.length>=4){
	  		str[i].innerHTML=str[i].innerHTML.substring(0,4)+"...";
	  	}else{
	  		str[i].innerHTMML=str[i].innerHTML;
	  	}
	  }
  }
  function gwc(){
	  document.getElementById("gwc").style.display="block";
	  document.getElementById("dzf").style.display="none";
	  document.getElementById("ddan").style.display="none";
	  document.getElementById("yhxx").style.display="none";
	  
	  document.getElementById("dianji").style.border="1px solid #B0C4DE";
	  document.getElementById("dianjit").style.border="none";
	  document.getElementById("dianjis").style.border="none";
	  document.getElementById("dianjif").style.border="none";
	  
  }
  function dzf(){
	  document.getElementById("gwc").style.display="none";
	  document.getElementById("dzf").style.display="block";
	  document.getElementById("ddan").style.display="none";
	  document.getElementById("yhxx").style.display="none";
	  
	  document.getElementById("dianji").style.border="none";
	  document.getElementById("dianjit").style.border="1px solid #B0C4DE";
	  document.getElementById("dianjis").style.border="none";
	  document.getElementById("dianjif").style.border="none";
  }
  function ddan(){
	  document.getElementById("gwc").style.display="none";
	  document.getElementById("dzf").style.display="none";
	  document.getElementById("ddan").style.display="block";
	  document.getElementById("yhxx").style.display="none";
	  
	  document.getElementById("dianji").style.border="none";
	  document.getElementById("dianjit").style.border="none";
	  document.getElementById("dianjis").style.border="1px solid #B0C4DE";
	  document.getElementById("dianjif").style.border="none";
	  
  }
  function xiugai(){
	  document.getElementById("gwc").style.display="none";
	  document.getElementById("dzf").style.display="none";
	  document.getElementById("ddan").style.display="none";
	  document.getElementById("yhxx").style.display="block";
	  
	  document.getElementById("dianji").style.border="none";
	  document.getElementById("dianjit").style.border="none";
	  document.getElementById("dianjis").style.border="none";
	  document.getElementById("dianjif").style.border="1px solid #B0C4DE";
  }
  
  </script>
</head>
<body>
<div id="top">
<a href="${pageContext.request.contextPath }/home.do">返回首页</a>
</div>
<div class="user">
   <div id="user">
     <img src="img/${user.avator }" id="avator">
      <div id=u-user>
       <label>${user.nickname }</label>
      </div>
   </div>
   
   <div class="tongji">
     <div id="t-ji"><label>交易次数</label><label>${user.order_sum }</label></div>
     <div id="t-jii"><label>消费总额</label><label>${user.consume_sum }</label></div>
     <div></div>
   </div>
   <div id="xian"></div>
   
   <div>
     <form action="${pageContext.request.contextPath }/gwc.do">
       <input type="submit" value="购物车" onclick="gwc()" id="dianji">
     </form>
      <input type="button" value="待支付" onclick="dzf()" id="dianjit">
 
       <input type="button" value="交易订单" onclick="ddan()" id="dianjis">
     
       <input type="button" value="修改个人信息" onclick="xiugai()" id="dianjif">
       <form action="${pageContext.request.contextPath }/logout.do">
       <input type="submit" value="一键退出" id="logout">
       </form>
   </div>
</div>
   <div id="kong"></div>
   <div id="yhxx">
     <form action="${pageContext.request.contextPath }/updateuser.do" id="yhx">
       <dl>
         <dt class="account">账户名</dt>
         <dd><input type="text" name="account" value="${user.account }" disabled="disabled" id="user-a"></dd>
       </dl>
       <input type="text" name="account" value="${user.account }" style="display:none;"/>
      <dl>
        <dt class="nich">用户昵称</dt>
        <dd><input type="text" value="${user.nickname }" id="nich" ></dd>
      </dl>
      <dl>
        <dt class="pass">用户密码</dt>
        <dd><input type="text" name="password" value="${user.password }" id="pass"></dd>
      </dl>
      <dl>
      <dt class="idcard">身份证号</dt>
        <dd><input type="text" name="idcard" value="${user.idcard }" id="idcard"></dd>
      </dl>
      <dl>
        <dt class="phone">手机号码</dt>
        <dd><input type="text" name="phone" value="${user.phone }" id="phone"></dd>
      </dl>
      <dl>
        <dt class="address">收货地址</dt>
        <dd><input type="text" name="address" value="${user.address }" id="address"></dd>
      </dl>
      <input type="submit" value="修改" id="xiug">
     </form>
  </div>
   
  <div id="gwc">
  
  </div>
  
  <div id="dzf">
  <div id="d-dzf">
<c:forEach items="${waitPay }" var="waitpay">
   <div id="s-service">
<img src="img/${waitpay.avator }" id="img">
   <form action="${pageContext.request.contextPath }/userwp.do">
     <input type="text" name="waitpay_id" value="${waitpay.waitpay_id }">
     <input type="submit" value="支付" id="ur-zf">
   </form>
 <div id="ss-service">
  <div id="sss-ser">
<label>${waitpay.goods_name }</label>
<label id="sum"> ￥${waitpay.sum }</label>
    </div>
     <div id="sss-sele">
               <input type="text" id="us-num" value="${waitpay.number}" onclick="insert()">
               <img alt="" src="img/jia.png" id="jia" onclick="changeslie(1)">
               <img alt="" src="img/jian.png" id="jian" onclick="changeslie(-1)">
       </div>
       <form action="${pageContext.request.contextPath }/delectdzf.do">
         <input type="text" name="waitpay_id" value="${waitpay.waitpay_id }">
         <input type="submit" value="删除"  id="shanchu">
       </form>
      </div>
      </div>
 </c:forEach>
 </div>
  </div>
  
 <div id="ddan">
 <div id="d-dan">
  <c:forEach items="${order }" var="order">
  <div id="dd-dan">
  <img src="img/${order.avator }" id="d-img">
  <div id="d-left">
  <label id="d-gn" class="zbc"> ${order.goods_name }</label>
  <label id="d-ls">￥${order.lump_sum }</label>
  <label id="d-num">共选${order.number }件</label>
  <form action="${pageContext.request.contextPath }/userorderbuy.do">
  <input type="text" name="goods_id" value="${order.goods_id }" style="display:none;">
  <input type="submit" value="再次购买" id="zcgm">
  </form>
  <form action="${pageContext.request.contextPath }/deletedanuser.do">
    <input type="text" name="order_id" value="${order.order_id }" style="display:none;">
    <input type="submit" value="删除" id="delete">
  </form>
  </div>
  </div>
  </c:forEach>
  </div>
  </div>
  
  
  
</body>
</html>